import {ApiProperty} from "@nestjs/swagger";
import {IsIn, IsNotEmpty, Min} from "class-validator";

export class SearchBookDto {
    @ApiProperty({
        description: "搜索的图书名"
    })
    @IsNotEmpty()
    searchValue: string;

    @ApiProperty({
        description: "数据长度"
    })
    @IsNotEmpty()
    size: number;
}

export class BooksDto {
    @ApiProperty({
        description: "图书id"
    })
    id: number;

    @ApiProperty({
        description: "图书名"
    })
    book_name: string;

    @ApiProperty({
        description: "作者"
    })
    book_author: string;

    @ApiProperty({
        description: "摘要"
    })
    book_abstract: string;

    @ApiProperty({
        description: "类型"
    })
    book_type: string;

    @ApiProperty({
        description: "标签",
        type: Array
    })
    book_label: object;

    @ApiProperty({
        description: "图片"
    })
    book_image: string;

    @ApiProperty({
        description: "链接"
    })
    book_link: string;

    @ApiProperty({
        description: "评分"
    })
    book_score: number;
}
